const sequelize = require("./db");
const { DataTypes } = require("sequelize");

module.exports = sequelize.define(
  "news",
  {
    id: {
      type: DataTypes.UUID,
      primaryKey: true,
      allowNull: false,
    },
    title: {
      type: DataTypes.STRING,
    },
    publishTime: {
      type: DataTypes.DATE,
    },
    address: {
      type: DataTypes.STRING,
    },
    cover: {
      type: DataTypes.STRING,
    },
    type: {
      type: DataTypes.INTEGER,
    },
    publishName: {
      type: DataTypes.STRING,
    },
    content: {
      type: DataTypes.TEXT("long"),
    },
    magic1: {
      type: DataTypes.STRING,
    },
    magic2: {
      type: DataTypes.STRING,
    },
    magic3: {
      type: DataTypes.STRING,
    },
    magic4: {
      type: DataTypes.STRING,
    },
  },
  {
    freezeTableName: true,
  }
);
